package com.hrt.demo.czd.service.impls;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hrt.demo.czd.bean.Address;
import com.hrt.demo.czd.dao.AddressDao;
import com.hrt.demo.czd.service.AddressService;
@Service
public class AddressServiceImpls implements AddressService{
	@Autowired
	private AddressDao addressDao;
	@Override
	public void saveAddress(Address address) throws Exception {
		addressDao.saveEntity(address);
		
	}
	@Override
	public void updateAddress(Address address) {
		addressDao.saveOrUpdateEntity(address);
		
	}
	@Override
	public void deleteById(Long[] ids) throws Exception {
		List<Address> adds=addressDao.getByIds(ids);
		for(Address add:adds)
		{
			add.setIsdelete(new Integer(1));
			addressDao.updateEntity(add);
		}
		
	}
	
}
